//
//  RBPhoto.h
//  Photo
//
//  Created by Ran on 16/4/8.
//  Copyright © 2016年 Justice. All rights reserved.

#import <UIKit/UIKit.h>
#import "RBPhotoModel.h"
#import "RBPhotoViewController.h"
#import "RBPhotoNavigationController.h"

typedef enum{
    RBPhotoShowStylePush,
    RBPhotoShowStylePresent,
    RBPhotoShowStyleZoom,
    RBPhotoShowStyleCustom
} RBPhotoShowStyle;

@class RBPhotoBrowser;
@protocol RBPhotoDelegate <NSObject>

@optional
- (void)rbPhoto: (RBPhotoBrowser *)photo didScrollToIndex:(CGFloat)index withPhotoController: (RBPhotoViewController *)controller;

- (void)rbPhoto:(RBPhotoBrowser *)photo willBeginDraggingwithPhotoController: (RBPhotoViewController *)controller;
- (void)rbPhoto:(RBPhotoBrowser *)photo willDismisswithPhotoController: (RBPhotoViewController *)controller;

- (void)rbPhoto: (RBPhotoBrowser *)photo longPressGesture: (UILongPressGestureRecognizer *)gesture atPhotoView: (RBPhotoView *)photoView withPhotoController: (RBPhotoViewController *)controller;
- (void)rbPhoto: (RBPhotoBrowser *)photo singleTapGesture: (UITapGestureRecognizer *)gesture atPhotoView: (RBPhotoView *)photoView withPhotoController: (RBPhotoViewController *)controller;
- (void)rbPhoto: (RBPhotoBrowser *)photo doubleTapGesture: (UITapGestureRecognizer *)gesture atPhotoView: (RBPhotoView *)photoView withPhotoController: (RBPhotoViewController *)controller;

@end

@interface RBPhotoBrowser : NSObject

@property(nonatomic, strong)NSArray *imageViews;
@property(nonatomic, strong)NSArray *photoModels;
@property(nonatomic, assign)NSInteger startIndex;
@property(nonatomic, assign)RBPhotoShowStyle showStyle;
@property(nonatomic, weak)UIViewController *fromController;
@property(nonatomic, weak)id<RBPhotoDelegate>delegate;

/**
 *  show photo browser
 *
 *  block: set nil except RBPhotoShowStyleCustom
 */
- (void)showWithCustomBlock: (void(^)( RBPhotoViewController * controller))block;

@property(nonatomic, assign) NSInteger currentIndex;
@property(nonatomic, weak, readonly)RBPhotoViewController *photoController;
- (void)deleteItemAtIndex: (NSInteger)index;

@end
